import { RouteRecordRaw } from 'vue-router'
import type { AppRouteRecordRaw } from '@/router/types';
import { ErrorPage404, ErrorPage403, ErrorPage500, Layout, RedirectHome, RedirectUnPublish } from '@/router/constant';
import { PageEnum } from '@/enums/pageEnum'
import { GoReload } from '@/components/GoReload'


export const LoginRoute : RouteRecordRaw = {
	path: PageEnum.BASE_LOGIN,
	name: PageEnum.BASE_LOGIN_NAME,
	component: () => import('@/views/login/index.vue'),
	meta: {
		title: '登录',
	},
};
// 自定义页面
export const CustomePage : RouteRecordRaw[] = [
	{
		path: "/stationWorkOrdersWithStatus",
		name: "stationWorkOrdersWithStatus",
		component: () => import('@/views/customPage/stationWorkOrdersWithStatus.vue'),
		meta: {
			title: '设备加工状态合并使用',
		},
	},
	{
		path: "/stationWorkOrders",
		name: "StationWorkOrders",
		component: () => import('@/views/customPage/stationWorkOrders.vue'),
		meta: {
			title: '获取工位关联的工单数量',
		},
	},
	{
		path: "/unBindUserStation",
		name: "UnBindUserStation",
		component: () => import('@/views/customPage/unBindUserStation.vue'),
		meta: {
			title: '获取未绑定用户的工位',
		},
	},
	{
		path: "/switchingPage",
		name: "switchingPage",
		component: () => import('@/views/customPage/switchingPage.vue'),
		meta: {
			title: '网页轮播',
		},
	},
	{
		path: "/stationCurrentDayYield",
		name: "stationCurrentDayYield",
		component: () => import('@/views/customPage/stationCurrentDayYield.vue'),
		meta: {
			title: '工位今日产量_自定义组件',
		},
	},
	{
		path: "/workStationRunInfo",
		name: "workStationRunInfo",
		component: () => import('@/views/customPage/workStationRunInfo.vue'),
		meta: {
			title: '工位运行明细',
		},
	},
	{
		path: "/dynamicSort",
		name: "dynamicSort",
		component: () => import('@/views/customPage/dynamicSort.vue'),
		meta: {
			title: '动态排序',
		},
	},
	{
		path: "/sationSort",
		name: "sationSort",
		component: () => import('@/views/customPage/sationSort.vue'),
		meta: {
			title: '工位排序',
		},
	},
	{
		path: "/workShopLayout",
		name: "workShopLayout",
		component: () => import('@/views/customPage/workShopLayout.vue'),
		meta: {
			title: '工厂布局',
		},
	},
];

export const HttpErrorPage : RouteRecordRaw[] = [
	{
		path: '/error/404',
		name: PageEnum.ERROR_PAGE_NAME_404,
		component: ErrorPage404,
		meta: {
			title: PageEnum.ERROR_PAGE_NAME_404,
		},
	},
	{
		path: '/error/403',
		name: PageEnum.ERROR_PAGE_NAME_403,
		component: ErrorPage403,
		meta: {
			title: PageEnum.ERROR_PAGE_NAME_403,
		},
	},
	{
		path: '/error/500',
		name: PageEnum.ERROR_PAGE_NAME_500,
		component: ErrorPage500,
		meta: {
			title: PageEnum.ERROR_PAGE_NAME_500,
		},
	},
]

export const ErrorPageRoute : AppRouteRecordRaw = {
	path: '/:path(.*)*',
	name: 'ErrorPage',
	component: ErrorPage404,
	meta: {
		title: PageEnum.ERROR_PAGE_NAME_404,
		hideBreadcrumb: true,
	}
};

export const ReloadRoute : AppRouteRecordRaw = {
	path: PageEnum.RELOAD,
	name: PageEnum.RELOAD_NAME,
	component: GoReload,
	meta: {
		title: PageEnum.RELOAD_NAME,
	},
}

export const RedirectRoute : RouteRecordRaw[] = [
	{
		path: PageEnum.REDIRECT,
		name: PageEnum.REDIRECT_NAME,
		component: RedirectHome,
		meta: {
			title: PageEnum.REDIRECT_NAME,
		},
	},
	{
		path: PageEnum.REDIRECT_UN_PUBLISH,
		name: PageEnum.REDIRECT_UN_PUBLISH_NAME,
		component: RedirectUnPublish,
		meta: {
			title: PageEnum.REDIRECT_UN_PUBLISH_NAME,
		},
	},
]